import request from '@/utils/request'
import request2,{getdata} from '@/utils/seleRequest'



export function queryByGradeList (data) {
    let select= 'srvjk_organ_cnt_grade_select'
    let condition = []
  if(data.area!=null&&data.area!=''){
    // condition =[{
    //   "colName": "release_date",
    //   "ruleType": "lt",
    //   "value": data.endDate
    // },{
    //   "colName": "release_date",
    //   "ruleType": "gt",
    //   "value": data.startDate
    // }] 
  }
  return request2({
        url: `/${select}?${select}`,
        method: 'post',
        data:getdata(select,condition)
    })
}

export function queryByAreaList (data) {
  
  let select= 'srvjk_organ_cnt_area_select'
  let condition = []
  if(data.area!=''&&data.area!=null){
    condition =[{
      "colName": "area_name",
      "ruleType": "like",
      "value": data.area
    },
    // {
    //   "colName": "area_cnt",
    //   "ruleType": "eq",
    //   "value": data.areaType
    // }
  ] 
  }
return request2({
      url: `/${select}?${select}`,
      method: 'post',
      data:getdata(select,condition)
  })
}

export function queryByClassifyList (data) {
  let select= 'srvjk_organ_cnt_class_select'
  let condition = []
  if(data.area!=null&&data.area!=''){
    // condition =[{
    //   "colName": "release_date",
    //   "ruleType": "lt",
    //   "value": data.endDate
    // },{
    //   "colName": "release_date",
    //   "ruleType": "gt",
    //   "value": data.startDate
    // }] 
  }
return request2({
      url: `/${select}?${select}`,
      method: 'post',
      data:getdata(select,condition)
  })
}

export function queryByAreaAndTypeList (data) {
  let select= 'srvjk_organ_cnt_area_class_select'
  let condition = []
  // if(data.area!=''&&data.area!=null){
  //   condition =[{
  //     "colName": "area_name",
  //     "ruleType": "like",
  //     "value": data.area
  //   },
    // {
    //   "colName": "area_cnt",
    //   "ruleType": "eq",
    //   "value": data.areaType
    // }
  // ] 
  // }
return request2({
      url: `/${select}?${select}`,
      method: 'post',
      data:getdata(select,condition)
  })
}
